package logic

import (
	"context"
	"gitignore/models/mysql"

	"gitignore/gitignorerpc/gitignorerpc"
	"gitignore/gitignorerpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type VideoTopicListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewVideoTopicListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VideoTopicListLogic {
	return &VideoTopicListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *VideoTopicListLogic) VideoTopicList(in *gitignorerpc.VideoTopicListRequest) (*gitignorerpc.VideoTopicListResponse, error) {
	// todo: add your logic here and delete this line

	var video mysql.Video

	var list []*gitignorerpc.VideoTopicList

	list = video.FindVideoByList(mysql.DB, list)

	return &gitignorerpc.VideoTopicListResponse{
		List: list,
	}, nil
}
